package com.activenetwork.smlite.page.rfp;

import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.NoSuchWindowException;
import org.openqa.selenium.WebDriver;

import com.activenetwork.smlite.page.generic.PageObject;
import com.activenetwork.smlite.page.rfp.RfpMaintenanceView.RfpReview;
import com.activenetwork.util.EnvContext;
import com.activenetwork.util.PageLoader;
import com.activenetwork.util.WindowLoader;

public class ViewRFPDetailTemplate implements PageObject {
	
	public String getPageHeader(){
		WebDriver driver = EnvContext.webDriverTL.get();
		try{
			return driver.findElement(By.cssSelector(".page-header h1")).getText();
		}catch(NoSuchElementException e){
			return "";
		}
	}
	
	public RfpReview close(WindowLoader winLoader){
		WebDriver driver = EnvContext.webDriverTL.get();
		try{
			driver.findElement(By.xpath("//button[@onclick='javascript:window.close();']")).click();
		}catch(NoSuchWindowException e){
			
		}
		winLoader.switchDefault(driver);
		return PageLoader.load(RfpReview.class);
	}
	
	

}
